﻿<Window x:Class="TFSProjectMigration.TFSWorkItemMigrationUI"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Total TFS Migration Tool" Height="626" Width="691">
    <Grid>
        <TabControl x:Name="MigrationTabControl" HorizontalAlignment="Left" Height="551" Margin="10,10,0,0" VerticalAlignment="Top" Width="653" TabStripPlacement="Left" SelectionChanged="MigrationTabControl_SelectionChanged" Background="#FFEBF5FF" BorderBrush="#FFBADBFD">
            <TabItem x:Name="ConnectionTab" Header="Connection" MinHeight="100" Margin="-2,-2,0,2" FontStretch="UltraExpanded" BorderBrush="#FFABD3FD" Foreground="#FF23578D">
                <TabItem.Background>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FFAED3F9" Offset="0"/>
                        <GradientStop Color="#FF729FCF" Offset="1"/>
                        <GradientStop Color="#FF6E9CCD" Offset="1"/>
                        <GradientStop Color="#FF7EBCFB" Offset="1"/>
                        <GradientStop Color="#FFBADBFD" Offset="0.007"/>
                        <GradientStop Color="#FF8BB5E0" Offset="0.65"/>
                        <GradientStop Color="#FFBBDCFD" Offset="0.215"/>
                    </LinearGradientBrush>
                </TabItem.Background>
                <Grid Height="541" VerticalAlignment="Top" Background="White">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="131*"/>
                        <ColumnDefinition Width="421*"/>
                    </Grid.ColumnDefinitions>
                    <GroupBox Header="Connection" HorizontalAlignment="Left" Height="201" Margin="10,20,0,0" VerticalAlignment="Top" Width="522" Grid.ColumnSpan="2">
                        <WrapPanel HorizontalAlignment="Left" Height="144" VerticalAlignment="Top" Width="486" Margin="11,20,0,0">
                            <Button x:Name="ConnectSourceProjectButton" Content="Connect To Source Project" HorizontalAlignment="Left" VerticalAlignment="Top" Width="151" Height="29" Click="ConnectSourceProjectButton_Click"/>
                            <Label Content="" Height="36" Width="248"/>
                            <Label Content="Source Project" HorizontalAlignment="Left" VerticalAlignment="Top" Width="129"/>
                            <TextBox x:Name="SourceProjectText" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" VerticalAlignment="Top" Width="339" Foreground="#FF152A57" IsReadOnly="True" IsUndoEnabled="False"/>
                            <Label Content="" Height="41" Width="13"/>
                            <Button x:Name="ConnectDestinationProjectButton" Content="Connect To Target Project" HorizontalAlignment="Left" VerticalAlignment="Top" Width="150" RenderTransformOrigin="0.504,1.273" Click="ConnectDestinationProjectButton_Click" Height="28"/>
                            <Label Content="" Height="36" Width="248"/>
                            <Label Content="Target Project" HorizontalAlignment="Left" VerticalAlignment="Top" RenderTransformOrigin="0.026,0.077" Width="129"/>
                            <TextBox x:Name="DestinationProjectText" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" VerticalAlignment="Top" Width="339" Foreground="#FF152A57" IsReadOnly="True" IsUndoEnabled="False"/>

                        </WrapPanel>
                    </GroupBox>
                    <GroupBox Header="Migration Options" HorizontalAlignment="Left" Margin="10,235,0,0" VerticalAlignment="Top" Width="522" Height="91" BorderBrush="#FFDADADA" Grid.ColumnSpan="2">
                        <DockPanel HorizontalAlignment="Left" Height="41" LastChildFill="False" VerticalAlignment="Top" Width="501" Margin="10,21,-1,0">
                            <Label Content="" Height="23" VerticalAlignment="Top" Width="28"/>
                            <CheckBox x:Name="ClosedTextBox" Content="Exclude 'Closed' items" Height="23" VerticalAlignment="Top" FontWeight="Normal"/>
                            <Label Content="" Height="23" VerticalAlignment="Top" Width="48"/>
                            <CheckBox x:Name="RemovedTextBox" Content="Exclude 'Removed' items" Height="23" VerticalAlignment="Bottom" Margin="0,0,0,18" FontWeight="Normal"/>
                        </DockPanel>

                    </GroupBox>
                    <Button x:Name="NextButton" Content="Next" HorizontalAlignment="Left" VerticalAlignment="Top" Width="97" Margin="298,492,0,0" Height="29" Click="NextButton_Click" Grid.Column="1">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3" Offset="0"/>
                                <GradientStop Color="#FFEBEBEB" Offset="0.5"/>
                                <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
                                <GradientStop Color="{DynamicResource {x:Static SystemColors.ActiveBorderColorKey}}" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                    <Label x:Name="ConnectionStatusLabel" Content="" HorizontalAlignment="Left" Margin="27,492,0,0" VerticalAlignment="Top" Width="346" FontStyle="Italic" Foreground="#FFBB1F1F" Background="Transparent" OpacityMask="Black" Grid.ColumnSpan="2" Height="26"/>

                </Grid>
            </TabItem>
            <TabItem x:Name="FieldCopyTab" Header="Field Copying" MinHeight="100" Margin="-2,-3,0,3" FontStretch="UltraExpanded" IsEnabled="False" BorderBrush="#FFABD3FD" Foreground="#FF23578D">
                <TabItem.Background>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FFAED3F9" Offset="0"/>
                        <GradientStop Color="#FF729FCF" Offset="1"/>
                        <GradientStop Color="#FF6E9CCD" Offset="1"/>
                        <GradientStop Color="#FF7EBCFB" Offset="1"/>
                        <GradientStop Color="#FFBADBFD" Offset="0.007"/>
                        <GradientStop Color="#FF8BB5E0" Offset="0.65"/>
                        <GradientStop Color="#FFBBDCFD" Offset="0.215"/>
                    </LinearGradientBrush>
                </TabItem.Background>
                <Grid Height="541" VerticalAlignment="Top" Background="White">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="249*"/>
                        <RowDefinition Height="292*"/>
                    </Grid.RowDefinitions>
                    <WrapPanel HorizontalAlignment="Left" Height="265" Margin="10,53,0,0" VerticalAlignment="Top" Width="531" Grid.RowSpan="2"/>
                    <GroupBox Header="Migrate Fields" HorizontalAlignment="Left" Height="256" Margin="10,20,0,0" VerticalAlignment="Top" Width="531" Grid.RowSpan="2">
                        <WrapPanel HorizontalAlignment="Left" Height="230" Margin="4,10,0,0" VerticalAlignment="Top" Width="511">
                            <Label Content="" Height="39" Width="13"/>
                            <Label Content="Select Work Item Type" HorizontalAlignment="Left" Height="31" VerticalAlignment="Top" Width="154"/>
                            <ComboBox x:Name="FieldTypes2ComboBox" HorizontalAlignment="Left" Height="26" VerticalAlignment="Top" Width="189" SelectionChanged="FieldTypes2ComboBox_SelectionChanged">
                                <ComboBox.OpacityMask>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="Black" Offset="0"/>
                                        <GradientStop Color="White" Offset="1"/>
                                    </LinearGradientBrush>
                                </ComboBox.OpacityMask>
                                <ComboBox.Background>
                                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                        <GradientStop Color="#FFF3F3F3" Offset="0"/>
                                        <GradientStop Color="#FFEBEBEB" Offset="0.5"/>
                                        <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
                                        <GradientStop Color="#FFDCD9D9" Offset="1"/>
                                    </LinearGradientBrush>
                                </ComboBox.Background>
                            </ComboBox>
                            <Label Content="" Height="35" Width="154"/>
                            <Label Content="" Height="149" Width="15"/>
                            <DataGrid x:Name="FieldToCopyGrid" Height="150" Width="484" AutoGenerateColumns="False" AlternatingRowBackground="#FFD9EFF7" Background="White" GridLinesVisibility="Vertical" VerticalGridLinesBrush="#FFE4E4E4" HorizontalScrollBarVisibility="Disabled">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Width="390" Header="Field" Binding="{Binding [0]}" IsReadOnly="True" />
                                    <DataGridTemplateColumn Width="Auto" MinWidth="70" Header="      Add">
                                        <DataGridTemplateColumn.CellTemplate>
                                            <DataTemplate>
                                                <CheckBox IsChecked="{Binding [1], Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" />
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellTemplate>
                                    </DataGridTemplateColumn>
                                </DataGrid.Columns>
                            </DataGrid>
                            <Label Content="" Height="41" Width="412"/>
                            <Button x:Name="CopyFieldsButton" Content="Copy" Height="24" Width="87" Click="CopyFieldsButton_Click"/>
                        </WrapPanel>
                    </GroupBox>
                    <GroupBox Header="Migrate WorkFlows" HorizontalAlignment="Left" Height="221" Margin="10,30,0,0" VerticalAlignment="Top" Width="531" Grid.Row="1">
                        <WrapPanel HorizontalAlignment="Left" Height="189" Margin="4,10,0,0" VerticalAlignment="Top" Width="511">
                            <Label Content="" Height="39" Width="13"/>
                            <DataGrid x:Name="WorkFlowListGrid" Height="156" Width="484" AutoGenerateColumns="False" AlternatingRowBackground="#FFD9EFF7" Background="White" GridLinesVisibility="Vertical" VerticalGridLinesBrush="#FFE4E4E4" HorizontalScrollBarVisibility="Disabled">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Width="395" Header="Work Item Type" Binding="{Binding [0]}" IsReadOnly="True" />
                                    <DataGridTemplateColumn Width="Auto" MinWidth="70" Header="      Add">
                                        <DataGridTemplateColumn.CellTemplate>
                                            <DataTemplate>
                                                <CheckBox IsChecked="{Binding [1], Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center"/>
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellTemplate>
                                    </DataGridTemplateColumn>
                                </DataGrid.Columns>
                            </DataGrid>
                            <Label Content="" Height="32" Width="412"/>
                            <Button x:Name="CopyWorkFlowsButton" Content="Copy" Height="24" Width="87" Click="CopyWorkFlowsButton_Click"/>
                        </WrapPanel>
                    </GroupBox>
                    <Button x:Name="NextButtonCopying" Content="Next" HorizontalAlignment="Left" VerticalAlignment="Top" Width="97" Margin="428,257,0,0" Height="29" Grid.Row="1" Click="NextButtonCopying_Click">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3" Offset="0"/>
                                <GradientStop Color="#FFEBEBEB" Offset="0.5"/>
                                <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
                                <GradientStop Color="{DynamicResource {x:Static SystemColors.ActiveBorderColorKey}}" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                </Grid>
            </TabItem>
            <TabItem x:Name="FieldMappingTab" Header="Field Mapping" MinHeight="100" Margin="-2,-3,0,3" FontStretch="UltraExpanded" IsEnabled="False" BorderBrush="#FFABD3FD" Foreground="#FF23578D">
                <TabItem.Background>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FFAED3F9" Offset="0"/>
                        <GradientStop Color="#FF729FCF" Offset="1"/>
                        <GradientStop Color="#FF6E9CCD" Offset="1"/>
                        <GradientStop Color="#FF7EBCFB" Offset="1"/>
                        <GradientStop Color="#FFADD2F8" Offset="0.007"/>
                        <GradientStop Color="#FF8BB5E0" Offset="0.65"/>
                        <GradientStop Color="#FFBBDCFD" Offset="0.215"/>
                    </LinearGradientBrush>
                </TabItem.Background>
                <Grid Background="White">
                    <GroupBox Header="Mismatched Fields" HorizontalAlignment="Left" Height="208" Margin="32,49,0,0" VerticalAlignment="Top" Width="477" BorderBrush="#FFDADADA">
                        <WrapPanel HorizontalAlignment="Left" Height="182" VerticalAlignment="Top" Width="461" Margin="2,0,0,0">
                            <DataGrid x:Name="SourceFieldGrid" HorizontalAlignment="Left" Height="159" Margin="2,13,0,0" VerticalAlignment="Top" Width="225" AlternatingRowBackground="#FFD9EFF7" Background="WhiteSmoke" AutoGenerateColumns="False" GridLinesVisibility="None">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Header="Source" Binding ="{Binding}" IsReadOnly="True" MaxWidth="225" MinWidth="200"/>
                                </DataGrid.Columns>
                            </DataGrid>
                            <DataGrid x:Name="TargetFieldGrid" HorizontalAlignment="Left" Height="159" Margin="2,13,0,0" VerticalAlignment="Top" Width="225" AlternatingRowBackground="#FFD9EFF7" Background="WhiteSmoke" AutoGenerateColumns="False" GridLinesVisibility="None">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Header="Target" Binding ="{Binding}" IsReadOnly="True"  MaxWidth="225" MinWidth="200"/>
                                </DataGrid.Columns>
                            </DataGrid>
                        </WrapPanel>
                    </GroupBox>
                    <ComboBox x:Name="FieldTypesComboBox" HorizontalAlignment="Left" Height="26" Margin="191,13,0,0" VerticalAlignment="Top" Width="189" SelectionChanged="SelectedValueChanged">
                        <ComboBox.OpacityMask>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="Black" Offset="0"/>
                                <GradientStop Color="White" Offset="1"/>
                            </LinearGradientBrush>
                        </ComboBox.OpacityMask>
                        <ComboBox.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3" Offset="0"/>
                                <GradientStop Color="#FFEBEBEB" Offset="0.5"/>
                                <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
                                <GradientStop Color="#FFDCD9D9" Offset="1"/>
                            </LinearGradientBrush>
                        </ComboBox.Background>
                    </ComboBox>
                    <Label Content="Select Work Item Type" HorizontalAlignment="Left" Height="31" Margin="32,10,0,0" VerticalAlignment="Top" Width="154"/>
                    <GroupBox Header="Map Fields" HorizontalAlignment="Left" Height="223" Margin="32,267,0,0" VerticalAlignment="Top" Width="477" BorderBrush="#FFDADADA">
                        <WrapPanel HorizontalAlignment="Left" Height="192" Margin="0,10,0,-1" VerticalAlignment="Top" Width="458">
                            <ComboBox x:Name="SourceFieldComboBox" Height="26" Width="154"/>
                            <Label Content="  To" Height="25" Width="41"/>
                            <ComboBox x:Name="DestFieldComboBox" Height="26" Width="154"/>
                            <Label Content="" Height="24" Width="37"/>
                            <Button x:Name="MapButton" Content="Map" Height="25" Width="72" Click="MapButton_Click"/>
                            <Label Content="  " Height="10" Width="456"/>
                            <DataGrid x:Name="MappedListGrid" Height="126" Width="458" AutoGenerateColumns="False" AlternatingRowBackground="#FFD9EFF7" Background="WhiteSmoke" GridLinesVisibility="Vertical" VerticalGridLinesBrush="#FFE4E4E4">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Width="190" Header="Source Field" Binding="{Binding [0]}" IsReadOnly="True" />
                                    <DataGridTextColumn Width="190" Header="Target Field"  Binding="{Binding [1]}" IsReadOnly="True"/>
                                    <DataGridTemplateColumn Width="Auto" MinWidth="70">
                                        <DataGridTemplateColumn.CellTemplate>
                                            <DataTemplate>
                                                <CheckBox IsChecked="{Binding [2], Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center"/>
                                            </DataTemplate>
                                        </DataGridTemplateColumn.CellTemplate>
                                    </DataGridTemplateColumn>
                                </DataGrid.Columns>
                            </DataGrid>
                            <Label Content="" Height="27" Width="382"/>
                            <Button x:Name="RemoveMapButton" Content="Remove" Height="23" Width="75" Click="RemoveMapButton_Click"/>
                        </WrapPanel>
                    </GroupBox>
                    <Button x:Name="NextButtonMapping" Content="Next" HorizontalAlignment="Left" VerticalAlignment="Top" Width="97" Margin="412,502,0,0" Height="29" Click="NextButtonMapping_Click">
                        <Button.Background>
                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                <GradientStop Color="#FFF3F3F3" Offset="0"/>
                                <GradientStop Color="#FFEBEBEB" Offset="0.5"/>
                                <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
                                <GradientStop Color="{DynamicResource {x:Static SystemColors.ActiveBorderColorKey}}" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.Background>
                    </Button>
                </Grid>
            </TabItem>
            <TabItem x:Name="StartTab" Margin="-2,-4,0,4" Header="Start" Height="21" VerticalAlignment="Bottom" MinHeight="100" FontStretch="UltraExpanded" IsEnabled="False" BorderBrush="#FFABD3FD" Foreground="#FF23578D">
                <TabItem.Background>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FFAED3F9" Offset="0"/>
                        <GradientStop Color="#FF729FCF" Offset="1"/>
                        <GradientStop Color="#FF6E9CCD" Offset="1"/>
                        <GradientStop Color="#FF7EBCFB" Offset="1"/>
                        <GradientStop Color="#FFADD2F8" Offset="0.007"/>
                        <GradientStop Color="#FF8BB5E0" Offset="0.65"/>
                        <GradientStop Color="#FFBBDCFD" Offset="0.215"/>
                    </LinearGradientBrush>
                </TabItem.Background>
                <Grid Background="#FFFDFDFD">
                    <Button x:Name="MigrationButton" Content="Migrate" HorizontalAlignment="Left" Margin="10,26,0,0" VerticalAlignment="Top" Width="134" Height="28" Click="MigrationButton_Click"/>

                    <Label x:Name="MigratingLabel" Content="" HorizontalAlignment="Left" Margin="10,450,0,0" VerticalAlignment="Top" Width="141"/>
                    <ProgressBar x:Name="StatusBar" HorizontalAlignment="Left" Height="22" Margin="10,490,0,0" VerticalAlignment="Top" Width="532" Foreground="#FF1BAA1B" Visibility="Hidden"/>
                    <GroupBox Header="Status" HorizontalAlignment="Left" Height="259" Margin="10,84,0,0" VerticalAlignment="Top" Width="532" BorderBrush="#FFABD3FD">
                        <ScrollViewer x:Name="StatusViwer" HorizontalAlignment="Left" Height="207" Margin="0,20,-2,0" VerticalAlignment="Top" Width="522" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Background="#FFFDFDFD">
                            <StackPanel x:Name="MigrationStatusTextBlock" VerticalAlignment="Top" HorizontalAlignment="Left">
                                <TextBlock x:Name="MigrationStatusText" TextWrapping="Wrap" Margin="0,0,0,20" ></TextBlock>
                            </StackPanel>
                        </ScrollViewer>
                    </GroupBox>
                    <TextBlock x:Name="CheckTestPlanTextBlock" Margin="10,357,366,158" Visibility="Hidden">
                        <Hyperlink x:Name="CheckTestPlanHyperLink" Click="CheckTestPlanHyperLink_Click"  >Check Migrated Test Plans</Hyperlink>
                    </TextBlock>
                    <TextBlock x:Name="CheckLogTextBlock" Margin="10,388,457,133" Visibility="Hidden">
                        <Hyperlink x:Name="CheckLogHyperLink" Click="CheckLog_Click">Check Log File</Hyperlink>
                    </TextBlock>
                </Grid>
            </TabItem>
        </TabControl>

    </Grid>
</Window>
